package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class SortPoint {
    public static void main(String[] args) {


        List<Point> list = new ArrayList<>();
        list.add(new Point(5, 8));
        list.add(new Point(3, 4));
        list.add(new Point(66,333) );
        Collections.sort(list,(o1,  o2)->o2.getX()-o1.getX());
        System.out.println(list);

    }
}
